FROM openjdk:17

RUN mkdir -p /app/logs \
    /app/temp

WORKDIR /app

ENV SERVER_PORT=8080

EXPOSE ${SERVER_PORT}

ADD ./target/main.jar ./app.jar

ENTRYPOINT ["java", \
            "-Djava.security.egd=file:/dev/./urandom", \
            "-Dserver.port=${SERVER_PORT}", \
            "-jar", "app.jar"]
